import QtQuick 1.0

Rectangle{
    id: _root
    x: 0
    y: 0
    width: parent.width
    height: _textEdit.font.pixelSize * 1.2
    color: "#dddddd"

    property alias text: _textEdit.text
    property alias fontPointSize: _textEdit.font.pointSize
    property alias textColor: _textEdit.color
    property alias textActiveFocus: _textEdit.activeFocus
    property alias focusEdit: _textEdit.focus

    signal pressKey(int key)

    function setForceActiveFocus(){
        _textEdit.focus = true;
        _textEdit.forceActiveFocus();
    }


    TextEdit {
        id: _textEdit
        x: 2
        y: 2
        width: parent.width - 2
        height: _root.height
        horizontalAlignment: TextEdit.AlignLeft
        color: "#000000"
        wrapMode: TextEdit.WordWrap
        textFormat: TextEdit.PlainText
        font.pixelSize: 12
        focus: true

        Keys.onPressed: {
            pressKey(event.key);
        }
    }

    Rectangle{
        anchors.fill: parent
        anchors.rightMargin: 1
        anchors.bottomMargin: 1
        border.color: "#ffffff"
        color: "#00000000"
    }
    Rectangle{
        anchors.fill: parent
        anchors.topMargin: 1
        anchors.leftMargin: 1
        border.color: "#aaaaaa"
        color: "#00000000"
    }

}

